package backend.ro.msg.gillardon.businesstripplanner.clujpopulation.parser;
 
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class WikiClujParser {
  
  
  private static final String URL = "http://en.wikipedia.org/wiki/Cluj-Napoca";
  
  
  public WikiClujParser() {
    
  }

  public String getPopulationCluj() throws IOException {
    
    System.setProperty("http.proxyHost", "proxy.msg.de");
    System.setProperty("http.proxyPort", "3128");

    Document doc = Jsoup.connect(URL).timeout(0).get();
    
   Element table = doc.select("table[class=infobox geography vcard]").first();
   Elements tr = table.select("tr"); 
    
   return tr.get(21).select("td").text();

  }
  
}
